package alogrithm.list;

public class LinkNode <T> {
	public int index;
	public T data;
	
	public LinkNode<T> next;
	public LinkNode<T> pre;
	
	public LinkNode(T data){
		this.data=data;
		this.index=0;
	}
	
	public int hashCode(){
		return super.hashCode()+this.data.hashCode();
	}

	public boolean equals(Object t){
		if(!(t instanceof LinkNode)){
			return false;
		}
		LinkNode<T> that=(LinkNode<T>)t;
		return this.data.equals(that.data);
	}
	public LinkNode(int index, T data) {
		this.data=data;
		this.index=index;
	}
	
	public String toString(){
		return String.valueOf(data);
	}
}
